package demoSingletion;

public class Test {

    public static void main(String[] args) {
        Singleton2 singleton = Singleton2.getInstance();
        Singleton2 singleton2 = Singleton2.getInstance();

        System.out.println(singleton == singleton2);
    }

    public static void main1(String[] args) {
        /*Singleton singleton1 = new Singleton();
        Singleton singleton2 = new Singleton();*/

        Singleton instance1 = Singleton.getInstance();

        Singleton instance2 = Singleton.getInstance();

        System.out.println(instance1 == instance2);
    }
}
